package com.alkandros.myloke.managers;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;

import com.alkandros.myloke.R;

public class HeaderManager {

	private Activity context;
	private LayoutInflater inflator;
	private View headerView;
	private TextView headingText;
	private ImageView imageViewIcon;
	private Button buttonRight;
	private RelativeLayout.LayoutParams relativeParams;
	String headingString;

	
	public HeaderManager(Activity context) {
		this.setContext(context);
		inflator = LayoutInflater.from(context);
//		this.headingString=string;
	}
	
	public int getHeader(RelativeLayout headerHolder) 
	{
		initializeUI();
		relativeParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
		relativeParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
		headerHolder.addView(headerView, relativeParams);
		return headerView.getId();
	}
	
	private void initializeUI() 
	{
			inflator 	= LayoutInflater.from(getContext());
			headerView 	= inflator.inflate(R.layout.header_layout, null);
		//	headerView	=((RelativeLayout) headerView.findViewById(R.id.textViewTitle));
			headingText = (TextView) headerView.findViewById(R.id.textViewTitle);
			imageViewIcon = (ImageView) headerView.findViewById(R.id.imageViewLeft);
			buttonRight = (Button) headerView.findViewById(R.id.buttonRight);
		//	headingText.setText(headingString);
	}
	public void setContext(Activity context) 
	{
		this.context = context;
	}
	public Activity getContext() 
	{
		return context;
	}
	
	public TextView getTitle()
	{
		return this.headingText;
	}
	public ImageView getImageLeft()
	{
		return this.imageViewIcon;
	}
	public Button getButtonRight()
	{
		return this.buttonRight;
	}
}
